import pytest


def test_d():
    print("---test_d")
    pass


@pytest.mark.dependency(depends=["d"])  # 依赖的不存在，结果也是skipped
def test_e():
    print("---test_e")
    pass


@pytest.mark.dependency(depends=["b"])
def test_f():
    print("---test_f")
    pass


# @pytest.mark.dependency(depends=["a"])
@pytest.mark.dependency(name="b", depends=["test_a", "c"])  # 可以依赖多个
def test_b():
    print("---test_b")
    pass


@pytest.mark.dependency(name="a")
@pytest.mark.xfail(reason="预期失败")
def test_a():
    print("---test_a")
    assert 1 == 2


@pytest.mark.dependency(name="c")
def test_c():
    print("---test_c")
    pass

if __name__ == '__main__':
    pytest.main()